home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 134 (1991-10)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 134 (1991-10)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / RxSlides / autosli.rexx next >
OS/2 REXX Batch file  |  1990-03-08  |  2KB  |  96 lines

  1. /* automatic slideshow of all .pic files on df1: */
  2.  
  3. /* get the disk directory */
  4.  
  5. address command 'list df1: p #?.pic nodates to ram:foo'
  6.  
  7. /* Start a slide process */
  8.  
  9. address command 'ram:RxSlides'
  10.  
  11. /* Set slideshow as new host address */
  12.  
  13. address SLIDES
  14.  
  15. /* Set up the slideshow transition mode and speed */
  16.  
  17. 'trans dissolve'
  18. if rc~=0 then call Saysts rc
  19.  
  20. 'speed 4096'
  21. if rc~=0 then call Saysts rc
  22.  
  23. /* Initialize input buffer and start reading the directory list */
  24.  
  25. instring = ""
  26. if open('dir','ram:foo','R') then instring = readln('dir')
  27.  
  28. /* The first line has the directory name, skip it */
  29.  
  30. if (length(instring) > 0) then instring = readln('dir')
  31.  
  32. do while (length(instring) > 0)
  33.  
  34.   /* get the first two strings on the line */
  35.  
  36.   parse var instring fname arg2 .
  37.  
  38.   /* Get the next line now, because we may jump out */
  39.   instring = readln('dir')
  40.  
  41.   /* The last line says "n files ...". Check for it */
  42.  
  43.   if arg2 = 'file' then break
  44.   if arg2 = 'files' then break
  45.  
  46.   /* Make sure this entry isn't a directory */
  47.  
  48.   if arg2 = 'Dir' then iterate
  49.  
  50.   /* Finally! Show the picture and hold it for 2 seconds */
  51.  
  52.   'show' 'df1:' || fname
  53.   if rc~=0 then call Saysts rc
  54.  
  55.   'wait 100'
  56.   if rc~=0 then call Saysts rc
  57.  
  58.   end
  59.  
  60. /* That's all, folks... */
  61.  
  62. 'exit'
  63.  
  64. /* clean up after ourselves */
  65.  
  66. i = close('dir')
  67. address command 'delete ram:foo'
  68.  
  69. exit
  70.  
  71. /* Prints the error message for exit "status" from RxSlides */
  72.  
  73. Saysts: procedure
  74.   arg status
  75. select
  76.   when status=1 then say "Unknown command received from ARexx"
  77.   when status=5 then say "File is not an ILBM picture file"
  78.   when status=6 then say "File is not a picture file"
  79.   when status=7 then say "Unable to open the file"
  80.   when status=8 then say "File contains an invalid picture size"
  81.   when status=9 then say "File is missing a bit map header"
  82.   when status=10 then say "File BMHD chunk is the wrong size"
  83.   when status=11 then say "Not enough memory for picture body"
  84.   when status=12 then say "File has an invalid decode flag"
  85.   when status=13 then say "Read error"
  86.   when status=14 then say "Insufficient memory"
  87.   when status=15 then say "Unable to open window"
  88.   when status=16 then say "Unable to open screen"
  89.   when status=21 then say "Program is exiting"
  90.   when status=22 then say "Invalid command-line arguments"
  91.   when status=23 then say "Unable to open required libraries"
  92.   when status=24 then say "Unable to open message port"
  93.   otherwise say "Unknown status code "status
  94.   end /* select */
  95.  
  96.